using Microsoft.AspNetCore.Mvc;
using Zhaoxi.Zhihu.HttpApi.Infrastructure;
using Zhaoxi.Zhihu.UseCases.Answers.Command;
using Zhaoxi.Zhihu.UseCases.AppUsers.Commands;
using Zhaoxi.Zhihu.UseCases.Questions.Command;

namespace Zhaoxi.Zhihu.HttpApi.Controllers;
[Route("question")]
public class QuestionController:ApiControllerBase
{

    /*[HttpPost("")]
    public async Task<IActionResult> CreateQuestion(CreateQuestionCommand command)
    {
        var result=await Sender.Send(command);
        return ReturnResult(result);
    }
    
    [HttpPut("CreateFollowQuestion")]
    public async Task<IActionResult> CreateFollowQuestion(CreateFollowQuestionCommand command)
    {
        var result = await Sender.Send(command);
        return ReturnResult(result);
    }
    
    [HttpPut("DeleteFollowQuestion")]
    public async Task<IActionResult> DeleteFollowQuestion(DeleteFollowQuestionCommand command)
    {
        var result = await Sender.Send(command);
        return ReturnResult(result);
    }
    */

    [HttpGet("question/{questionId:int}")]
    public async Task<IActionResult> GetQuestion(int questionId)
    {
        var result=await Sender.Send(new GetQuestionQuery(questionId));
        return ReturnResult(result);
    }
}